package cn.initcap.designpattern.principle.compositionaggregation;

/**
 * @author initcap
 * @date 2018/8/28 AM9:15
 */
public class ProductDao {
    private AbstractDatabaseConnection dbConnection;

    public void setDbConnection(AbstractDatabaseConnection dbConnection) {
        this.dbConnection = dbConnection;
    }

    public void addProduct() {
        String conn = dbConnection.getConnection();
        System.out.println("使用" + conn + "增加产品");
    }
}
